package controller;
import model.Cinema;
import model.Seat;
import model.ShowTime;

/**
 * 
 * @author Anders
 *
 */
public class StatusSeat 
{
	private Seat seat;
	private Cinema cinema;
	private ShowTime showTime;
	public static enum STATUS {RESERVED, SOLD, FREE}
	private STATUS status;
	
	public StatusSeat(Seat seat, Cinema c, ShowTime s, STATUS sta)
	{
		this.seat = seat;
		this.cinema = c;
		this.showTime = s;
		this.status = sta;
	}

	public Seat getSeat() 
	{
		return seat;
	}

	public Cinema getCinema() 
	{
		return cinema;
	}

	public ShowTime getShowTime() 
	{
		return showTime;
	}
	
	public STATUS getStatus()
	{
		return status;
	}
	
	public void setStatus(STATUS sta)
	{
		this.status = sta;
	}
	
	@Override
	public boolean equals(Object obj)
	{
		boolean success = true;
		
		try {
			StatusSeat otherSSeat = (StatusSeat) obj;
			success = seat.equals(otherSSeat.getSeat()) && cinema.equals(otherSSeat.getCinema()) && showTime.equals(otherSSeat.getShowTime()) && status == otherSSeat.getStatus(); 
		}
		catch(Exception e)	{
			success = false;
		}
		return success;
	}
}
